package cn.suhaoblog.oss.controller;

import cn.suhaoblog.core.door.CommonResponse;
import cn.suhaoblog.oss.entity.OSSFile;
import com.aliyun.oss.OSS;
import com.aliyun.oss.model.PutObjectRequest;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/test")
@Api(tags = {"测试test控制器"}, protocols = "HTTP", authorizations = @Authorization("Authorization"))
public class TestController {


    @ApiOperation(value = "blame someone")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "上传的文件", required = true, paramType = "formData", dataType = "file")
    })
    @RequestMapping(value = "upload", method = RequestMethod.GET)
    public String insert(String folder) {
        return folder;
    }
    @ApiOperation(value = "blame someone")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "上传的文件", required = true, paramType = "formData", dataType = "file")
    })
    @RequestMapping(value = "upload", method = RequestMethod.DELETE)
    public String delete(String folder) {
        return folder;
    }
    @ApiOperation(value = "blame someone")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "上传的文件", required = true, paramType = "formData", dataType = "file")
    })
    @RequestMapping(value = "upload1", method = RequestMethod.POST)
    public String post(String folder) {
        return folder;
    }

    @ApiOperation(value = "delete another")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "上传的文件", required = true, paramType = "formData", dataType = "file")
    })
    @RequestMapping(value = "delete", method = RequestMethod.DELETE)
    public String p11ost(String folder) {
        return folder;
    }
    @ApiOperation(value = "test put")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "上传的文件", required = true, paramType = "formData", dataType = "file")
    })
    @RequestMapping(value = "upload", method = RequestMethod.PUT)
    public String put(String folder) {
        return folder;
    }

}
